package dyyx;

import fi.iki.elonen.NanoHTTPD;

public abstract class HttpServerUtil {
	
	
	public static void start(int port,WebServerHandler handler) throws Exception{
		NanoHTTPD httpd = new SimpleHttpServer(port,handler);
	}
	
	public static void start(int port) throws Exception{
		WebServerHandler handler = new SimpleWebServerHandler();
		NanoHTTPD httpd = new SimpleHttpServer(port,handler);
	}
	
	
	
	public static void startAsync(int port,WebServerHandler handler) throws Exception{
		
		
	}
	
	public static void main(String[] args) throws Exception {
		
		int port = 8070;
		System.out.println("port="+port);
		start(port);
        System.out.println("http server start done,port="+port);
        while(true) {
        	Thread.sleep(5000);
        }

	}


	
}
